<?php
namespace App\Listeners;

use App\Events\In\NormalBuyingFinished;
use App\Events\In\StudentAppointmentStatusChanged;
use App\Facades\KafkaBridge;
use App\Models\InviteOneOnOneStudent;
use Carbon\Carbon;

class InviteOneOnOneOnStudentAppointmentStatusChanged
{
    public function handle(StudentAppointmentStatusChanged $event)
    {
        $studentId = $event->studentId;
        if (intval($event->toStatus) !== 3) return;

        if (intval($event->roomTypeId) !== 7) return;

        //1对1邀请特权，记录是否上过课
        InviteOneOnOneStudent::setInviteStatus($studentId, 0, 1);
    }
}